Functions of Functions and the Exponential Function
Exponential Growth and Decline
Exponential growth is typically expressed as
Figure: Exponential growth curve
Details
Exponential growth is the rate of population increase across time when a population is devoid of limiting factors (i.e. competition, resources, etc.) and experiences a constant growth rate.
Exponential growth is typically expressed as:
where
A
(sometimes denotedP
) = initial population sizek
= growth ratet
=number of time intervals
Note that exponential growth occurs when and exponential decline occurs when .
The Exponential Function
An exponential function is a function with the form:
Details
For the exponential function , is a positive integer and is a fixed positive real number. The equation can be rewritten as:
When the exponential function is written as then, it has a growth rate at time equivalent to the value of for the function at .
Properties of the Exponential Function
Recall that the methods of the basic arithmetic implies that:
for any real numbers and .
Functions of Functions
Details
Consider two functions, and , each defined for some set of real numbers. Where can be solved in function using when exists for all such resulting . If and exist then we can compute for any .
If
then
If we call the resulting function , then . Another common notation for this is
Examples
If and , then
and
Storing and Using R Code
As R code gets more complex (more lines) it is usually stored in files. Functions are typically stored in separate files.
Examples
Save the following file (test.r
):
x=4
y=8
cat("x+y is", x+y, "\n")
To read the file use:
source("test.r")
and the outcome of the equation is displayed in R.
Storing and Calling Functions In R
To save a function in a separate file use a command of the form function.r
.
Examples
f<-function(x) { return (exp(sum(x))) }
can be stored in a file function.r
and subsequently read using the source
command.